//
//  LSSpaceCell.m
//  lightSpot
//
//  Created by lightSpot on 2022.
//  Copyright © 2022 lightSpot. All rights reserved.
//

#import "LSSpaceCell.h"

@implementation LSSpaceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setData:(id)data delegate:(id)delegate {
    
    if ([data isKindOfClass:[NSDictionary class]]) {
        if ([data[@"data"] isKindOfClass:[LSSpaceCellModel class]]) {
            LSSpaceCellModel *model = data[@"data"];
            if (model.bagroundColor) {
                self.contentView.backgroundColor = model.bagroundColor;
            } else {
                self.contentView.backgroundColor = [UIColor clearColor];
            }
        }
    }
}

@end


#pragma mark - Model

@implementation LSSpaceCellModel

+ (LSSpaceCellModel *)ittemModelWithBagroundColor:(UIColor *)bagroundColor {
    LSSpaceCellModel *model = [LSSpaceCellModel new];
    model.bagroundColor = bagroundColor;
    return model;
}

@end
